package com.kelvin.oocl.util;

import com.kelvin.oocl.bookproducer.BookProducer;
import com.kelvin.oocl.bookproducer.BookProducerImpl;

public class ProducerFactory {
	private static ProducerFactory factory;
	private static String mqUril = "tcp://127.0.0.1:61616";
	
	private ProducerFactory() {
	}
	
	public static ProducerFactory newInstance(){
		if(null==factory){
			synchronized (ProducerFactory.class) {
				if(null==factory){
					factory = new ProducerFactory();
				}
			}
		}
		return factory;
	}
	
	public BookProducer newBookProducer(String queueName){
		return new BookProducerImpl(queueName, mqUril);
	}
}
